This feature is only accessible via the Python SDK.
- A
redact_pii
setting, which can be toggled on or off in theweave.init
call to enable PII redaction. - Automatic redaction of common entities when
redact_pii = True
. - Customizable redaction fields using the configurable
redact_pii_fields
setting.
Enable PII redaction
To get started with the Sensitive Data Protection feature in Weave, complete the following steps:-
Install the required dependencies:
-
Modify your
weave.init
call to enable redaction. Whenredact_pii=True
, common entities are redacted by default: -
(Optional) Customize redaction fields using the
redact_pii_fields
parameter:For a full list of the entities that can be detected and redacted, see PII entities supported by Presidio.
Entities redacted by default
The following entities are automatically redacted when PII redaction is enabled:CREDIT_CARD
CRYPTO
EMAIL_ADDRESS
ES_NIF
FI_PERSONAL_IDENTITY_CODE
IBAN_CODE
IN_AADHAAR
IN_PAN
IP_ADDRESS
LOCATION
PERSON
PHONE_NUMBER
UK_NHS
UK_NINO
US_BANK_NUMBER
US_DRIVER_LICENSE
US_PASSPORT
US_SSN
Redacting sensitive keys with REDACT_KEYS
In addition to PII redaction, the Weave SDK also supports redaction of custom keys using REDACT_KEYS
. This is useful when you want to protect additional sensitive data that might not fall under the PII category but needs to be kept private. Examples include:
- API keys
- Authentication headers
- Tokens
- Internal IDs
- Config values
Pre-defined REDACT_KEYS
Weave automatically redacts the following sensitive keys by default:
Adding your own keys
You can extend this list with your own custom keys that you want to redact from traces:client_id
and whatever_else
will appear as "REDACTED"
:
Usage information
- This feature is only available in the Python SDK.
- Enabling redaction increases processing time due to the Presidio dependency.